<?php  
isset($_SESSION['arrStaffPermission'])? $arrPermission = $_SESSION['arrStaffPermission'] : $arrPermission = array();
?>	
<div class="content-view">
<form  method="POST" Name="inndex" autocomplete="off">
	<?php echo $this->formHidden("hdn_option","",null); ?>
	<?php echo $this->formHidden("hdn_object_id","",null); ?>
	<?php echo $this->formHidden("hdn_object_id_list",$this->iStaffIdList,null); ?>
	<?php echo $this->formHidden("hdn_filter_to_view",$this->strFilter,null); ?>
	<?php
		$arrConst = $this->arrConst;
		$sUrlView  = "../add/";
	?>
	<div class = "searh-fixed">
		<div class = "normal_title">
			<?=$this->titleBody;?>
		</div>
		<div class="search-container">
			<table id = "table-search">
				<col width = "20%">
				<col width = "80%">
				<tr>
					<td><label class = "normal_label" for = "C_PROFILE_STATUS"><?=$arrConst['_TU_KHOA_TIM_KIEM']?></label></td>
					<td>
						<input onchange="ResetSearch()" type="text" id="txtFullTextSearch" optional = "true" name="txtFullTextSearch" class="textbox" value="<?= $this->sFullTextSearch ?>" />
					</td>
				</tr>
			</table>
		</div>
		<div class = "button-link-container" align = "right">
			<div class = "blc-left">
				<input type="button" value="<?=$arrConst['_TIM_KIEM']?>" class="link-button"  onclick="checkvalue();">
			</div>
			<div class = "blc-right">
				<input type="button" value="Ban quyền NSD" class="link-button"  onclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'../add/');">
				<input type="button" value="Xóa" class="link-button"  onclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'../delete/');">
			</div>
		</div>
	</div>
	<div id = "table-container">
		<table cellpadding="0" cellspacing="0" border="0" align="center" class="list-table-data" id="table-data">
			<?php			
			$delimitor = $this->delimitor;
			$StrHeader = explode("!~~!"
			,Efy_Publib_Library::_GenerateHeaderTable(
			"5%" 
			.$delimitor ."20%"
			.$delimitor . "25%" 
			.$delimitor . "25%" 
			.$delimitor . "25%" 
			,'<input optional = "true" type="checkbox" name="chk_all_item_id" value="" onclick="checkbox_all_item_id(document.forms[0].chk_item_id);">' 
			.$delimitor . "Họ và tên"
			.$delimitor . "Tên đăng nhập"
			.$delimitor . "Email"
			.$delimitor . "Nhóm quyền" 
			,$delimitor));
			echo $StrHeader[0];					
			echo $StrHeader[1];
			$arrResult = $this->arrResult;
			//var_dump($arrResult);
			$count = sizeof($arrResult);
			$v_current_style_name = "round_row";	
			for($index = 0;$index < $count;$index++){
				$staffId = $arrResult[$index]['PK_NET_ID'];
				$staffId = str_replace('{', '', $staffId);
				$staffId = str_replace('}', '', $staffId);	
				$name = $arrResult[$index]['C_FULLNAME'];
				$accname = $arrResult[$index]['C_USERNAME'];
				$email = $arrResult[$index]['C_EMAIL'];
				$role = $arrResult[$index]['C_ROLE'];
				
				if ($v_current_style_name == "odd_row"){
					$v_current_style_name = "round_row";
				}else{
					$v_current_style_name = "odd_row";					
				}?>
				
				<tr class="<?=$v_current_style_name?>">	
					<td align="center" style="padding-left:3px;padding-right:3px;" class="normal_label">				
						<?=$this->formCheckbox('chk_item_id',$staffId, array('checked' => false,'onclick' =>'selectrow(this)'))?>					
					</td>
					<td ondblclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'<?=$sUrlView?>')" onclick="set_hidden(this,document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id'),'<?=$staffId?>');" align="left"  class="normal_label" ><?= $name ?></td>													
					<td ondblclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'<?=$sUrlView?>')" onclick="set_hidden(this,document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id'),'<?=$staffId?>');" align="left"  class="normal_label"><?=$accname?></td>
					<td ondblclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'<?=$sUrlView?>')" onclick="set_hidden(this,document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id'),'<?=$staffId?>');" align="left" valign="middle" class="normal_label"><?=$email?></td>
					<td ondblclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'<?=$sUrlView?>')" onclick="set_hidden(this,document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id'),'<?=$staffId?>');" align="left" valign="middle" class="normal_label"><?=$role?></td>
				</tr><?php
			}
			if($count < 15){	
				echo Efy_Library::_addEmptyRow($this->iCountElement,15 - $count,$v_current_style_name,5);		
			}?>
		</table>
	</div>
	<div class = "button-container">
		<input type="button" value="Ban quyền NSD" class="link-button"  onclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'../add/');">
		<input type="button" value="Xóa" class="link-button"  onclick="iTemOnclick(document.getElementsByName('chk_item_id'),document.getElementById('hdn_object_id_list'),'../delete/');">
	</div>
</form>
</div>
<script type="text/javascript">
	shortcut.add("Ctrl+K",function() {
		document.getElementById('txtfullTextSearch').focus();
		document.getElementById('txtfullTextSearch').select();
	});
	$(document).ready(function(){
		fixTitle();
	});
</script>